<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<base href="../../../" />
		<script src="list.js"></script>
		<script src="page.js"></script>
		<link type="text/css" rel="stylesheet" href="page.css" />
	</head>
	<body>
		[page:Mesh] &rarr;

		<h1>[name]</h1>

		<div class="desc">A mesh that can blend together multiple animated morph targets.</div>

		<h2>Example</h2>
		[example:webgl_morphtargets_md2_control morphtargets / md2 / controll]


		<h2>Constructor</h2>


		<h3>[name]([page:Geometry geometry], [page:Material material])</h3>
		<div>
		geometry — An instance of [page:Geometry].<br />
		material — An instance of [page:Material] (optional).
		</div>

		<h2>Properties</h2>


		<h3>[property:object animationsMap]</h3>
		<div>
		An object of named animations as added by [page:MorphBlendMesh.createAnimation].
		</div>

		<h3>[property:array animationsList]</h3>
		<div>
		The list of animations as added by [page:MorphBlendMesh.createAnimation].
		</div>

		<h2>Methods</h2>



		<h3>[method:null setAnimationWeight]([page:String name], [page:Float weight])</h3>
		<div>
		name -- The name of the animation<br />
		weight -- Weight of the animation, typically 0-1
		</div>
		<div>
		Set the weight of how much this animation will apply to the overall morph. 0 is off, 1 is full weight.
		</div>

		<h3>[method:null setAnimationFPS]([page:String name], [page:Float fps])</h3>
		<div>
		name -- The name of the animation <br />
		fps -- The number of frames (morphTargets) per second
		</div>
		<div>
		A frame is typically 1 morph target.
		</div>

		<h3>[method:null createAnimation]([page:String name], [page:Integer start], [page:Integer end], [page:Float fps])</h3>
		<div>
		name -- The name of the animation <br />
		start -- The starting frame (morph)<br />
		end -- The ending frame (morph)<br />
		fps -- How many frames (morphs) to play per second
		</div>
		<div>
		Creates an animation object that gets added to both the [page:MorphBlendMesh.animationsMap animationsMap] and
		[page:MorphBlendMesh.animationsList animationsList].<br/><br/>

		Animation object:<br/><br/>
		startFrame -- Starting frame<br/>
		endFrame -- Ending frame<br/>
		length -- The number of frames<br/>
		fps -- The frames per second<br/>
		duration -- The length of the animation in seconds<br/>
		lastFrame -- The previous frame that was played<br/>
		currentFrame -- The current frame<br/>
		active -- Whether or not the animation is being played<br/>
		time -- The time in seconds of the animation<br/>
		direction -- Which way to play the animation<br/>
		weight -- The weight of the animation<br/>
		directionBackwards -- Is playing backwards<br/>
		mirroredLoop -- Loop back and forth
		</div>

		<h3>[method:null playAnimation]([page:String name])</h3>
		<div>
		name -- The name of the animation
		</div>
		<div>
		Sets the animation to active and animation time to 0
		</div>

		<h3>[method:null update]([page:Float delta])</h3>
		<div>
		delta -- Time in seconds
		</div>
		<div>
		Updates and plays the animation
		</div>

		<h3>[method:null autoCreateAnimations]([page:Float fps])</h3>
		<div>
		fps -- Frames per second
		</div>
		<div>
		Goes through the geometry's morphTargets and generates animations based on the morphTargets' names. Names
		are of the form "walk_01", "walk_02", "walk_03", etc or "run001", "run002", "run003".
		</div>

		<h3>[method:null setAnimationDuration]([page:String name], [page:Float duration])</h3>
		<div>
		name -- The name of the animation <br />
		duration -- How long in seconds to play the animation
		</div>
		<div>
		Updates the animation object with proper values to update the duration.
		</div>

		<h3>[method:null setAnimationDirectionForward]([page:String name])</h3>
		<div>
		name -- The name of the animation
		</div>
		<div>
		Sets the animation to play forwards
		</div>

		<h3>[method:null setAnimationDirectionBackward]([page:String name])</h3>
		<div>
		name -- The name of the animation
		</div>
		<div>
		Sets the animation to play backwards
		</div>

		<h3>[method:Float getAnimationDuration]([page:String name])</h3>
		<div>
		name -- The name of the animation
		</div>
		<div>
		Returns the duration in seconds of the animation. Returns -1 if it can't be found.
		</div>

		<h3>[method:Float getAnimationTime]([page:String name])</h3>
		<div>
		name -- The name of the animation
		</div>
		<div>
		Returns the current time position of the animation.
		</div>

		<h3>[method:null setAnimationTime]([page:String name], [page:Float time])</h3>
		<div>
		name -- The name of the animation <br />
		time -- The time in seconds
		</div>
		<div>
		Sets the current time position of the animation
		</div>

		<h3>[method:null stopAnimation]([page:String name])</h3>
		<div>
		name -- The name of the animation
		</div>
		<div>
		Stops the playback of the animation
		</div>

		<h2>Source</h2>

		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
	</body>
</html>
